<template>
	<view>
		<view style="margin-left: -50rpx;margin-top: -30rpx;">
			<helang-blur :params="params"></helang-blur>
			<view style="position: absolute;margin-top: -300rpx;z-index: 999;padding: 30rpx;margin-left: 60rpx;">
				<image :src="videoinfos.smallPhoto" mode="scaleToFill"
					style="width: 170rpx;height: 240rpx;border-radius: 10rpx;border-style:solid;border-width:1px;border-color:#FFFFFF;">
				</image>
			</view>
			<view
				style="z-index: 999;position: absolute;margin-top: -300rpx;z-index: 999;padding: 30rpx;margin-left: 260rpx;">
				<text style="font-size: 36rpx;font-weight: 600;color: #FFFFFF;">{{videoinfos.name}}</text>

				<text v-if="videoinfos.grade>0"
					style="margin-left: 20rpx;color: #FC8D15;font-weight: 700;font-size: 30rpx;">{{videoinfos.grade}}</text>
				<text v-if="videoinfos.grade<=0" style="margin-left: 20rpx;color:#cecece ;">暂无评分</text>
				<view style="margin-top: 10rpx;width: 100%;">
					<text style="font-size: 26rpx;font-weight: 500;color: #FFFFFF;">导演：{{videoinfos.director}}</text>
				</view>
				<view style="margin-top: 10rpx;width: 100%;" class="hide">
					<text
						style="font-size: 26rpx;font-weight: 500;color: #FFFFFF;">主演：{{videoinfos.mainPerformer}}</text>
				</view>
				<view style="margin-top: 10rpx;width: 100%;">
					<text
						style="font-size: 26rpx;font-weight: 500;color: #FFFFFF;">类型：{{videoinfos.genre | formatB}}/{{videoinfos.duration}}</text>
				</view>
				<view style="margin-top: 10rpx;width: 100%;">
					<text style="font-size: 26rpx;font-weight: 500;color: #FFFFFF;">{{videoinfos.showDate | formatDate}}上映</text>
				</view>
			</view>

		</view>
		<view style="display: block;">
			<view style="padding: 30rpx;">
				<text style="font-size: 34rpx;font-weight: 500;color: #000000;">剧情简介</text>
				<u-line color="#787878" margin="30rpx 0rpx 0rpx 0rpx" style="600rpx"/>
			</view>
			
			<view style="padding: 0rpx 30rpx;">
				
				<rich-text style="font-size: 30rpx;font-weight: 300;color: #000000;" :nodes="videoinfos.description">
				</rich-text>
			</view>
		</view>
		<view style="padding: 30rpx;position:fixed;bottom:20rpx;width: 100%;">
			<u-button v-if="videoinfos.filmStatus =='Y'" type="error" @click="govcinema(videoinfos)">立即购票</u-button>
			<!-- <u-button v-else type="warning">暂未上映</u-button> -->
		</view>
	</view>
</template>

<script>
	import Config from '../../common/config.js'
	import helangBlur from "@/components/helang-blur/helang-blur.vue"
	export default {
		components: {
			helangBlur
		},
		data() {
			return {
				img: "http://film-image.piaosiling.com/film/2021/28759-SPhoto.jpg",
				videoinfos: {},
				params: {
					width: '110%',
					height: '330rpx',
					image: "",
					blur: "m"
				},
			}
		},
		onLoad() {

			this.videoinfos = JSON.parse(Config.videoInfo)
			this.params.image = this.videoinfos.smallPhoto
			uni.setNavigationBarTitle({
				title: this.videoinfos.name
			})
		},
		filters: {
			formatA: function(value) {
				value = value + ""
				let a = value.replace(/\//g, ' ')
				return a
			},
			formatB: function(value) {
				value = value + ""
				let a = value.replace(/,/g, '/')
				return a
			},
			formatDate: function(value) {
				// value = value.toString().replace(/-/g, "/");
				let TIME = value+""
				TIME = TIME.replace(/-/g, "/");
				var date = new Date(TIME); //时间戳为10位需*1000，时间戳为13位的话不需乘1000
				var Y = date.getFullYear() + '年';
				var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '月';
				var D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + '日 ';
				var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
				var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) ;
				//var s = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
				return Y + M + D + h + m;
			},
		},
		methods: {
			govcinema(item) {
				// uni.switchTab({
				// 	url: "/pages/cinema/cinema"
				// })

				//console.log(item)
				uni.navigateTo({
					url: '/pages/videocinema/videocinema?name=' + item.name + '&filmId=' + item.filmId
				});
			},
			govcinemas() {
				uni.switchTab({
					url: "/pages/cinema/cinema"
				})
				// uni.navigateTo({
				// 	url: '/pages/videocinema/videocinema?name=' + this.Hotlist[index].name + '&filmId=' + this
				// 		.Hotlist[index].filmId
				// });
			},
		}
	}
</script>

<style>
	.info {
		background-color: #EA5344;
		height: 400rpx;
		width: 100%;
		padding: 20rpx;
	}
	.hide {
		display: -webkit-box;
		/*设置为弹性盒子*/
		-webkit-line-clamp: 1;
		/*最多显示1行*/
		overflow: hidden;
		/*超出隐藏*/
		text-overflow: ellipsis;
		/*超出显示为省略号*/
		-webkit-box-orient: vertical;
		/* 从上向下垂直排列子元素。 */
	
	}
</style>
